package it.ionize;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.util.Enumeration;
import java.util.ResourceBundle;

import sun.security.util.Resources;

import net.sourceforge.squirrel_sql.client.IApplication;
import net.sourceforge.squirrel_sql.client.action.SquirrelAction;
import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.DialogWidget;
import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.docktabdesktop.SmallTabButton;
import net.sourceforge.squirrel_sql.client.gui.session.SQLInternalFrame;
import net.sourceforge.squirrel_sql.client.plugin.DefaultSessionPlugin;
import net.sourceforge.squirrel_sql.client.plugin.PluginSessionCallback;
import net.sourceforge.squirrel_sql.client.plugin.PluginSessionCallbackAdaptor;
import net.sourceforge.squirrel_sql.client.session.IObjectTreeAPI;
import net.sourceforge.squirrel_sql.client.session.ISession;
import net.sourceforge.squirrel_sql.fw.sql.DatabaseObjectType;
import net.sourceforge.squirrel_sql.fw.util.IResources;
import net.sourceforge.squirrel_sql.plugins.editextras.EditExtrasPlugin;

public class BlobExtractorPlugin extends DefaultSessionPlugin {

	@Override
	public String getAuthor() {
		return "Daniele catellani";
	}

	@Override
	public String getDescriptiveName() {
		return "Dan Plugin";
	}

	@Override
	public String getInternalName() {
		return "danblobextractor";
	}

	@Override
	public String getVersion() {
		return "0.0.1";
	}

	@Override
	public PluginSessionCallback sessionStarted(final ISession session) {
		
		
		// Add context menu items to the object tree's view and procedure nodes.  
//		IObjectTreeAPI otApi = session.getSessionInternalFrame().getObjectTreeAPI();

		//		session.getSQLPanelAPIOfActiveSessionWindow().addSQLPanelListener(arg0)getSQLResultExecuter().getSelectedResultTab().getSqlString();
		
		//crea una entry nella tool list (ctrl+t)
//		session.getSessionInternalFrame().getSQLPanelAPI().addToToolsPopUp("nuovaAction", new MyAction(getApplication(),resource));
		
		

		//aggiunge il menu al tasto destro nella finestra sql
//		session.getSessionInternalFrame().getSQLPanelAPI().addToSQLEntryAreaMenu(new MyAction(getApplication(),resource));
		
		
		session.getSessionInternalFrame().getSQLPanelAPI().addToSQLEntryAreaMenu(new OpenWindgetMenu(this, session));

//		otApi.addToPopup(DatabaseObjectType.TABLE, new MyMenu(this, session));
//		otApi.addToPopup(DatabaseObjectType.COLUMN, new MyMenu(this, session));
		
		return new PluginSessionCallbackAdaptor(this) {
			@Override
			public void sqlInternalFrameOpened(SQLInternalFrame sqlInternalFrame, ISession sess) {
			}
		};
	}

}
